/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.code.server2client;

import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import java.io.IOException;
import java.math.BigDecimal;

/**
 *
 * @author ChengJiLi
 */
public class MsgResult {

    public static byte[] EnCode(MsgResult msg) throws IOException {
        Codec<MsgResult> Lcode = ProtobufProxy.create(MsgResult.class);
        return Lcode.encode(msg);
    }

    public static MsgResult DeCode(byte[] data) throws IOException {
        Codec<MsgResult> Lcode = ProtobufProxy.create(MsgResult.class);
        return Lcode.decode(data);

    }
    @Protobuf
    public boolean success;
    @Protobuf
    public int returnID;
    @Protobuf
    private byte[] bitword;
    private String word;
    @Protobuf
    private byte[] bitremark;
    @Protobuf
    private BigDecimal big;
    private String remark;
    private double[] amount;

    public MsgResult() {
    }

    public MsgResult(boolean success, int returnID, String word) {
        this.success = success;
        this.returnID = returnID;
        this.bitword = word.getBytes();
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public boolean getSuccess() {
        return success;
    }

    public void setReturnID(int returnID) {
        this.returnID = returnID;
    }

    public int getReturnID() {
        return returnID;
    }

    public boolean isSuccess() {
        return success;
    }

    /**
     * @return the bitword
     */
    public byte[] getBitword() {
        return bitword;
    }

    public void setBitword(byte[] bitword) {
        this.bitword = bitword;
        this.word = new String(getBitword());
    }

    public void setWord(String word) {
        this.word = word;
        this.bitword = word.getBytes();
    }

    public String getWord() {
        return word;
    }

    /**
     * @return the remark
     */
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
        this.bitremark = remark.getBytes();
    }

    public byte[] getBitremark() {
        return bitremark;
    }

    public void setBitremark(byte[] bitremark) {
        this.bitremark = bitremark;
        this.remark = new String(bitremark);
    }

    /**
     * @return the amount
     */
    public double[] getAmount() {
        return amount;
    }

    /**
     * @param amount the amount to set
     */
    public void setAmount(double[] amount) {
        this.amount = amount;
    }

    public BigDecimal getBig() {
        return big;
    }

    public void setBig(BigDecimal big) {
        this.big = big;
    }
}
